﻿using Framework;

public class AllowSkillBreakEffector : BaseEventEffector
{
    public bool AllowSkillBreak;

    public override void DoEvent(ObjHandle<LogicEntity> owner, params object[] allParams)
    {
        owner.handle.GetLogicComponent<LogicStateMachineComponent>().AllowSkillBreak = AllowSkillBreak;
    }

    public override void OnDestroy()
    {
    }

    public override void Serialize(EByte ms)
    {
        ms.WriteInt(AllowSkillBreak ? 1 : 0);
    }

    public override void Deserialize(EByte ms)
    {
        AllowSkillBreak = ms.ReadInt() == 1;
    }
}
